﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Xml.Serialization;

namespace MergerProject
{
    public interface IMerger
    {
         string tfsUrl { get; set; }
        /// <summary>
        /// tfssrv1:8080/tfs/defaultcollection
        /// </summary>

         void Initialize(string url, string defaultProjectName);
          DataTable mergeTable  { get; set; }
          TFSServerList myCustomServerList  { get; set; }
           DataTable changeSetDetailsTable { get; set; }

            bool bulkmergeStarted { get; set; }
            string selectedUser { get; set; }
            string selectedProjectName { get; set; }
             DataTable branchTable { get; set; }

              List<string> workItemIDs { get; set; }

              

         DataTable GetServers();

         string getUserName();

       // returns WorkItemCollection
         object GetWorkItemListFromWorkItemIds(List<string> workItemIDList);


         List<FilteredWorkItemChangests> getWorkItemsChangeSetList(object _workItemCollection);


         void FillMergeTable();


         DataTable GetMergeChangeSetTable();



         DataTable GetMergeChangeSetDetailTable();

        //parameter Workspace
        void ShowResolveConflictsDlg(object wrkspc);
        void ShowResolveConflictsDlg();


         DataTable getAllUsersTable();


         DataTable getUserWorkItemListTable();



         DataTable getProjectsDataTable();


         DataTable getBranchListTable();


         void DetermineWorkSpaces(string sourceBranch, string destBranch);


         bool MergeChangeSet(string workItemId, string changeSetId, string comment, bool GetLatest);



         void StartBulkMerge();

         void StartBulkMerge(List<string> selectedItems);

         bool OnlyCheckIn(string workItemId, string comment, string[] files);



    }


    /// <summary>
    /// FilteredWorkItemChangests class has changesetlist which are not merged to target branch 
    /// </summary>
    public class FilteredWorkItemChangests
    {
        public string workitemID;
        public string workitemDesc;
        public List<object> changeSetList = new List<object>();

    }

    [XmlRoot(ElementName = "TFSServerList")]
    public class TFSServerList
    {
        [XmlElement("TFSServer")]
        public List<TFSServer> serverList { get; set; }
    }
    public class TFSServer
    {

        public string TfsUrl { get; set; }
    }

}



